<template>
  <common_print_dialog ref="common_print_dialog" businessType="PRE_BIN" v-bind="$attrs" v-on="$listeners"
    :generateUrl="$url['oms/generateBatchBoxNo']" printUrl="/print-api/client/ClientPrintRpc/print.json" :printHandler="(data, list) => {
    data.metaDataList = list.map(it => ({
      metadata: { binNo: it, printType: data.type, },
      printNum: data.printNumSum,
    }))
    return data
  }" previewUrl="/print-api/client/ClientPrintRpc/previewPrintBase.json" :previewHandler="(data, code) => {
    data.metadata = JSON.stringify({ binNo: code, printType: data.type, })
    return data
  }" />
</template>

<script>
import common_print_dialog from './common_print_dialog.vue'
export default {
  components: { common_print_dialog },
  data() {
    return {

    }
  },
  methods: {

    show({ generateUrl }) {
      if (generateUrl) {
        this.generateUrl = generateUrl
      }
      this.$refs.common_print_dialog.show([], {}, {
      })
    },

  }
}
</script>
